package QL;

import java.util.List;
import java.util.ArrayList;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class ButlerBankItemLog implements IQLResponse
{
    /// <summary>
    /// 玩家Id
    /// </summary>
    public long UserId;

    /// <summary>
    /// 玩家昵称
    /// </summary>
    public String Nickname;

    /// <summary>
    /// 交易类型 1存入 2取出 3赠送 4接收
    /// </summary>
    public long LogType;

    /// <summary>
    /// 物品名称
    /// </summary>
    public String ItemName;

    /// <summary>
    /// 起始数量
    /// </summary>
    public long OriginCount;

    /// <summary>
    /// 变化量
    /// </summary>
    public long Delta;

    /// <summary>
    /// 关联玩家Id
    /// </summary>
    public long ReferUserId;

    /// <summary>
    /// 关联玩家昵称
    /// </summary>
    public String ReferNickname;

    /// <summary>
    /// 创建时间
    /// </summary>
    public String CreateTime;

    @Override
    public void DeserializeFromJson(JSONObject jsonObj)
    {
        JSONObject t = jsonObj;
        if (t.has("user_id"))
            UserId = t.getLong("user_id");
        if (t.has("nickname"))
            Nickname = t.getString("nickname");
        if (t.has("log_type"))
            LogType = t.getLong("log_type");
        if (t.has("item_name"))
            ItemName = t.getString("item_name");
        if (t.has("origin_count"))
            OriginCount = t.getLong("origin_count");
        if (t.has("delta"))
            Delta = t.getLong("delta");
        if (t.has("refer_user_id"))
            ReferUserId = t.getLong("refer_user_id");
        if (t.has("refer_nickname"))
            ReferNickname = t.getString("refer_nickname");
        if (t.has("create_time"))
            CreateTime = t.getString("create_time");
    }
}
